//
// Unihan Input Method
//
// Copyright © 2002-2007 Sun Wah Linux Ltd.
//
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
// USA
//
// $Id: IMM.h 757 2007-05-10 08:19:31Z roger $
//

/* FILE : IMM.h */
#ifndef _IMM_H
#define _IMM_H

extern UnihanIM *UIM;

#define IMM_VERSION "1.0"

void IMM_show_preedit_string		(const IME_InputContext *ic);

void IMM_hide_preedit_string		(const IME_InputContext *ic);

void IMM_update_preedit_string		(const IME_InputContext *ic,
					 const IME_String *string);

void IMM_update_preedit_caret		(const IME_InputContext *ic,
					 int   caret);

void IMM_show_aux_string		(const IME_InputContext *ic);

void IMM_hide_aux_string		(const IME_InputContext *ic);

void IMM_update_aux_string		(const IME_InputContext *ic,
					 const IME_String *string);

void IMM_show_candidates_list		(const IME_InputContext *ic);

void IMM_hide_candidates_list		(const IME_InputContext *ic);

void IMM_update_candidates_list		(const IME_InputContext *ic,
					 const IME_CandidatesList *candidates);

void IMM_set_focused_candidate		(const IME_InputContext *ic,
					 int   index);

void IMM_commit_string			(const IME_InputContext *ic,
					 const char *string);

void IMM_register_properties		(//const IME_InputContext *ic,
					 const char *uuid,
					 const IME_PropertiesList *properties);

void IMM_update_property		(const IME_InputContext *ic,
					 const IME_Property *property);

void IMM_read_config			(const char *key,
					 char  *buf,
					 size_t buf_size);

void IMM_write_config			(const char *key,
					 const char *value);

void IMM_load_user_data			(const char *key,
					 void **buf,
					 size_t *buf_size);

void IMM_free_user_data			(void *buf);

void IMM_save_user_data			(const char *key,
					 const void *buf,
					 size_t buf_size);

void IMM_start_helper			(const IME_InputContext *ic,
					 const char *helper_uuid);

void IMM_stop_helper			(const IME_InputContext *ic,
					 const char *helper_uuid);

void IMM_send_helper_event		(const IME_InputContext *ic,
					 const char *helper_uuid,
					 const void *buf,
					 size_t buf_size);

void IMM_beep				(const IME_InputContext *ic,
					 IME_Beep_Type type);

/* a util function */
void IMM_set_functions (IMM_Functions **imm);

#endif /* _IMM_H */

// vi:ts=4:nowrap:cin:expandtab
